package com.yanfei.zero.infrastructure.db;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.yanfei.zero.application.DbService;
import com.yanfei.zero.domain.user.model.EventStore;
import com.yanfei.zero.domain.user.model.User1;
import com.yanfei.zero.domain.user.repository.EventStoreRepository;
import com.yanfei.zero.domain.user.repository.User1Repository;

import jakarta.annotation.Resource;
@Service
public class MsDb extends DbService<EventStore>{
    @Resource
    private EventStoreRepository eventStoreRepository;

	@Resource
	private User1Repository user1Repository;

	@Override
	public void save(EventStore event) {
		eventStoreRepository.save(event);
	}
	// @Cacheable(cacheNames ="user",key = "#id" )
	public User1 getUser(long id){
     return  user1Repository.getReferenceById(id);
	}



}
